package com.handwriting;

import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @author victorydeng
 * @Classname Mytest
 * @Description TODO
 * @Date 2020/6/24 19:19
 * @Created by victorydeng
 */
public class Mytest {


    class personUtils{

        public String convert(String params){
            params = "被告:中国电信股份有限公司西宁分公司,原告:广州市君临文化传播有限公司";
            if(params.startsWith("原告")) {
                return  params;
            } else {
                System.out.println(params.substring(params.indexOf(",") + 2, params.length()) +"," + params.substring(0, params.indexOf(","))  );
            }
            return null;
        }
    }

    public static void main(String[] args) throws ParseException {
//        String  params = "被告:广州潼绵化妆品有限公司,被告:陈建华,被告:广州宝莱生物科技有限公司,被告:杭州阿里巴巴广告有限公司,原告:厦门萌力星球网络有限公司";
//        if(params.startsWith("原告")) {
//
//        } else {
//
//            System.out.println( params.substring(params.lastIndexOf(",") + 1, params.length()) +"," + params.substring(0, params.lastIndexOf(","))  );
//        }

        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
        Date t1 = formatter.parse("2020-04-23", new ParsePosition(0));
        Date t2 = formatter.parse("2020-06-29", new ParsePosition(0));
        // 获取相差的天数
        int betweenDays = (int) ((t2.getTime() - t1.getTime()) / (1000L * 3600L * 24L));
        System.out.println("==相差的天数===>"+betweenDays);



    }
}
